<template>
  <div class="chart-wrapper">
    <span class="date">{{titleInfo.time}}</span>
    <div class="title">
      <!-- <span class="big">SO<span style="vertical-align:sub;font-size:12px;">2</span>趋势图</span><span class="sub">炼铁3号高炉热风炉</span> -->
      <span class="big">{{titleInfo.title}}</span><span class="sub">{{titleInfo.subTitle}}</span>
    </div>
    <div class="unit-date">
      <span class="unit">{{titleInfo.unit}}</span>
      <span class="date">{{titleInfo.time}}</span>
    </div>
    <div class="content">
      <slot></slot>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'ChartWrapper',
    props: {
      titleInfo: {
        type: Object,
        default: () => ({
          title: '',
          subTitle: '',
          unit: '',
          time: ''
        })
      }
    }
  }
</script>

<style lang="less" scoped>
.chart-wrapper {
  position: relative;
  > .date {
    position: absolute;
    bottom: 0;
    left: 20px;
    color: #ffffff;
  }
}
.chart-wrapper {
  width: 100%;
  height: 260px;
  background-color: rgba(5, 27, 52, 0.8);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 14px;
  .title {
    width: 100%;
    height: 48px;
    background: linear-gradient(90deg, rgba(30, 226, 224, 0.2) 0%, rgba(5, 27, 52, 0.2) 100%);
    color: #ffffff;
    font-family: zcoolwenyiti;
    padding: 13px 20px 6px;
    line-height: 1;
    border-bottom: 1px solid;
    border-image: linear-gradient(90deg, #1EE2E0,rgba(0, 0, 0, 0.3)) 10 10;
    .big {
      font-size: 28px;
      margin-right: 20px;
    }
    .sub {
      font-size: 16px;
    }
  }
  .unit-date {
    color: #ffffff;
    background-color: rgba(5, 27, 52, 0.3);
    display: flex;
    justify-content: space-between;
    line-height: 1;
    padding: 0 20px;
    padding-top: 20px;
    font-size: 14px;
  }
  .content {
    width: 100%;
    height: calc(100% - 48px - 34px);
    background-color: rgba(5, 27, 52, 0.3);
  }
}
</style>
